#include <iostream>

using namespace std;

int main( )
{
    char *p[4]={"apple","dog","cat","boy"},*t;
    int i,j;

   
    for(i=0;i<4-1;i++)
        for(j=0;j<4-1-i;j++)
            if(strcmp(p[j],p[j+1])>0)
            {
                t=p[j];
                p[j]=p[j+1];
                p[j+1]=t;
            }

   for(i=0;i<4;i++)
   {
       cout<<p[i]<<"  ";
  
       cout<<*(p+i)<<" ";
   }

     cin>>i;
     return 0;
}


